Apache Struts 2 Web Application Development by Dave Newton
Author:Dave Newton [Dave Newton ]
Language: eng
Format: epub, pdf
Publisher: Packt Publishing
The servletConfig interceptor
The servletConfig interceptor sets various servlet-specification-related variables (for example, the session attribute map) on appropriate actions. We discussed the servletConfig interceptor when we covered the ApplicationAware, SessionAware, RequestAware, ParameterAware, ServletRequestAware, ServletResponseAware, and the ServletContextAware interfaces.
All this interceptor does is check for the implementation of each of the interfaces listed earlier (plus PrincipalAware) and set the appropriate action property if the action implements the corresponding interface.
For example, if our action implements SessionAware, it must implement the method void setSession(Map). The servletConfig interceptor checks for an implementation of SessionAware. If found, it casts the action to SessionAware and sets the session attribute map using the setSession() method, using code similar to the following (it's more or less the same idea for the other interfaces):
public String intercept(ActionInvocation invocation) throws Exception { Object action = invocation.getAction(); ActionContext context = invocation.getInvocationContext(); if (action instanceof SessionAware) { ((SessionAware) action) setSession(context.getSession()); }
Download
Apache Struts 2 Web Application Development by Dave Newton.pdf
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Hello! Python by Anthony Briggs(9929)
The Mikado Method by Ola Ellnestam Daniel Brolund(9794)
Dependency Injection in .NET by Mark Seemann(9351)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7796)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7571)
Svelte with Test-Driven Development by Daniel Irvine(7314)
Test-Driven Development with PHP 8 by Rainier Sarabia(7054)
Layered Design for Ruby on Rails Applications by Dementyev Vladimir;(6909)
Secrets of the JavaScript Ninja by John Resig & Bear Bibeault(6542)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6429)
Web Development with Django by Ben Shaw Saurabh Badhwar(6372)
React Application Architecture for Production by Alan Alickovic(6092)
Jquery UI in Action : Master the concepts Of Jquery UI: A Step By Step Approach by ANMOL GOYAL(5817)
Kotlin in Action by Dmitry Jemerov(5077)
Audition by Ryu Murakami(4595)
Software Architecture for Web Developers by Mihaela Roxana Ghidersa(4533)
Accelerating Server-Side Development with Fastify by Manuel Spigolon Maksim Sinik & Matteo Collina(4386)
Hands-On Full-Stack Web Development with GraphQL and React by Sebastian Grebe(4325)
Solidity Programming Essentials by Ritesh Modi(4091)
